<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>管理员登录</title>
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/easyui1.5/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/easyui1.5/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/login.css" >
	<script type="text/javascript" src="<%=request.getContextPath() %>/easyui1.5/jquery.min.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath() %>/easyui1.5/jquery.easyui.min.js"></script>
</head>
<body class="main">
	
		<form id="ff">
			<div class="easyui-panel" id="dl" style="width:400px;padding:30px 60px;border-radius: 20px;">
				<div style="text-align: center;margin-bottom: 20px;">
					<span style="color: cornflowerblue;font-size: 24px;font-weight: bolder;">管理员登录</span>
				</div>
				<div style="margin-bottom:20px">
					<input class="easyui-textbox" name="username" prompt="用户名" iconWidth="28" style="width:100%;height:34px;padding:10px;">
				</div>
				<div style="margin-bottom:20px">
					<input class="easyui-passwordbox" name="password" prompt="密  码" iconWidth="28" style="width:100%;height:34px;padding:10px">
				</div>
				<div style="text-align: center;">			
					<input type="button" value="登录" onclick="fnLogin()" style="background-color: green;height:30px;width:80px;border-radius: 6px;border: 1px solid green;color: white;">
				</div>
			</div>
		</form>
	
</body>

	<script type="text/javascript">
		$(function(){
		})
		function fnLogin(){
			 $.ajax({
				url:"user/login",
				type:"post",
				data:$("#ff").serialize(),
				success:function(data){
					if(data==1){
						alert("用户名不存在");
					}else if(data==2){
						alert("密码错误");
					}else if(data==3){
						alert("登录成功");
						location.href="page/main";
					}
				},dataType:"json"
				
			}) 
		}
	</script>
</html>